package com.cn.recloud.UploadAndDownload;

import io.minio.MinioClient;

/**
 * @description: 上传文件到minIO文件存储系统中  存储桶是testwang  存储对象名称是abc.txt
 * @author: wayne Wang
 * @date: 2020/7/30
 */
public class FileUploader {
    public static void main(String[] args) {
        try {
            MinioClient minioClient = new MinioClient("http://192.168.6.210:9000/", "admin", "p@ssw0rd");
            boolean isExist = minioClient.bucketExists("testwang");
            if (isExist) {
                System.out.println("已经存在");
            } else {
                minioClient.makeBucket("testwang");
            }
            minioClient.putObject("testwang", "abc.txt", "D:\\abc.txt");
            System.out.println("传入成功");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
